<?php include('src/cenviadaExterna_cs.php');
@session_start();
$_SESSION['varMenu'] = 'Registrar'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="../js/jquery.js" type="text/javascript"></script>
<script type="text/javascript" src="../js/collapse.js"></script>
<script type="text/javascript" src="../js/boxover.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Correspondencia Enviada Externa</title>
<style>

         
         .dvhdr1 {
            background:#000000;
            font-family:arial;
            font-size:12px;
			font-weight:bold;
			color:#FFFFFF;
            border:1px solid #C8BA92;
            padding:5px;
            width:250px;
         }
         
         .dvbdy1 {
            background:#FBFBFB;
            font-family:arial;
            font-size:12px;
            border-left:1px solid #C8BA92;
            border-right:1px solid #C8BA92;
            border-bottom:1px solid #C8BA92;
            padding:5px;
            width:250px;
         }


       
</style>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body class="style">

<div id="container">
  <?php include('header.php');?>
  <div id="mainContent">  
    <?php include('menuTop.php');?>
    <div id="bg">
		<form name="form1" id="form1" method="post" action="">
      <table width="100%" cellpadding="0" cellspacing="0">        
        <tr>
          <td colspan="5">
		  <table width="100%" bgcolor="#82241B">
              <tbody>
                <tr>
                  <td width="20%"> 
						<input type="button" name="agregar" id="agregar" 
						value="Agregar Archivo" onclick="location.href='agregarCenviadaExterna.php'"/> 
				  </td>
                  <td width="20%"> </td>
                  <td width="20%">
				  <input name="buscar" type="text" size="35"
					value="<?php if(isset($buscarValue)) echo $buscarValue?>" />
                  </td>
                  <td width="20%" align="center"><input type="submit" name="Submit" value="Search"/></td>
                </tr>
              </tbody>
          </table></td>
        </tr>
        <tr>
          <td colspan="2" align="left">
			<?php echo $totalArchivos;?> of 
			<a href="?inicio=<?php echo $inicio?>&cantidad=<?php echo $cantidad;?>"
			style="text-decoration:none; color:#FF0000"><?php echo '<B>'.$all.'</B>';?>
			</a>
			</td>
          <td colspan="3" align="right">
		  	<a href="?inicio=0&cantidad=25<?php echo $parametrosBuscador?>" style="text-decoration:none; color:#0000FF">25</a> |
			<a href="?inicio=0&cantidad=50<?php echo $parametrosBuscador?>" style="text-decoration:none; color:#0000FF">50</a> |
			<a href="?inicio=0&cantidad=100<?php echo $parametrosBuscador?>" style="text-decoration:none; color:#0000FF;">100</a> |
			<a href="?inicio=0&cantidad=<?php echo $all.$parametrosBuscador?>" style="text-decoration:none; color:#0000FF">All</a>
		  </td>
        </tr>
        <tr>
          <td colspan="5" align="center"> </td>
        </tr>
      </table>
      <h1>        Lista Archivos<br />
      </h1>
      <div id="list"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td colspan="8" align="center" valign="middle"><table width="100%" height="20px" border="0" align="left" cellpadding="0" cellspacing="0">
        <tr>
          <td width="1%" bgcolor="#000000">&nbsp;</td>
          <td width="22%" align="center" valign="middle" bgcolor="#000000"><h1><a href="#" style="text-decoration:none; color:#FFFFFF">NUMERO DE RADICADO</a></h1></td>
          <td width="1%" background="images/item.png" bgcolor="#000000">&nbsp;</td>
          <td width="22%" align="center" valign="middle" bgcolor="#000000"><h1>RECEPCION</h1></td>
          <td width="1%" background="images/item.png" bgcolor="#000000">&nbsp;</td>
          <td width="22%" align="center" valign="middle" bgcolor="#000000"><h1>SERIE - SUBSERIE</h1></td>
        
       		
          <td width="1%" background="images/item.png" bgcolor="#000000">&nbsp;</td>          
		  <td width="14%" align="center" valign="middle" bgcolor="#000000"><h1>Acciones</h1></td>
		
          <td width="1%" bgcolor="#000000">&nbsp;</td>
        </tr>
      </table></td>
      </tr>
  </table>
  <?php 
		for($i=0;$i<count($listRegistros);$i++)
		{ 
		  
	?>  
  <table width="100%" border="0" cellspacing="0" cellpadding="0" id="<?php echo 'tr'.$i;?>" >
    <tr>
      <td bgcolor="#FBFBFB">
		  <table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				  <td width="1%">&nbsp;</td>
				  <td width="22%" align="center"><?php echo $listRegistros[$i]->radicado;?></td>
				  <td width="1%" background="images/item.png">&nbsp;</td>
				 <td align="center" width="22%"><?php echo $listRegistros[$i]->recepcion;?></td>
				  <td width="1%" background="images/item.png">&nbsp;</td>
				  <td width="22%" align="center"><?php echo $listRegistros[$i]->serie;?></td>
				  <td width="1%" background="images/item.png">&nbsp;</td>
				  <td width="14%" align="center">
					  <table width="100%" border="0" cellpadding="2" cellspacing="0" class="iconosTabla">
						<tr>
						  <td align="center" valign="middle">
						 
						 <a href="viewEnviadaExterna.php?code=<?php echo $listRegistros[$i]->creeCodigo;?> " style="text-decoration:none;"
						 title="Ver más">								
						<img src="images/ver.png" alt="Ver" width="22" height="23" border="0" /></a>					 
						 
						 </td>
						  <td align="center" valign="middle">						  
						  <a href="editarCenviadaExterna.php?code=<?php echo $listRegistros[$i]->creeCodigo;?>" style="text-decoration:none;"
						  title="Editar Correspondencia">
						  <img src="images/editar.png" alt="Editar" width="15" height="17" border="0" /></a>
						  </td>
						  <td align="center" valign="middle">
						
						  <a href="src/deletecenviadaExterna_cs.php?code=<?php echo $listRegistros[$i]->creeCodigo;?>" style="text-decoration:none;"
									 onclick="javascript: return confirmarEliminacion();" title="Eliminar correspondecia">
									<img src="images/eliminar_reg.png" alt="Eliminar" width="14" height="17" border="0" /></a>
						
						  </td>
						  <td align="center" valign="middle"><input type="checkbox" /></td>
						</tr>
					  </table>
				  </td>
				  
				  <td width="1%">&nbsp;</td>
			</tr>
		  </table>
	  </td>
    </tr>
  </table>
	  <?php }
		if($totalArchivos>$cantidad)
		{ 
		?>
		<table width="70%" border="0" align="center" bgcolor="#FFFFFF">
			<tr>
				<td align="left" width="33%">
					<a href="<?php echo $anterior;?>" class="texto_link"><strong>Anterior</strong></a>
				</td>
				<td align="center" width="34%"><?php echo $paginas;?></td>
				<td align="right" width="33%">
					<a href="<?php echo $siguiente;?>" class="texto_link"><strong>Siguiente</strong></a>
				</td>
			</tr>
		</table>
  		<?php }?>
  
  </td>
    </tr>
  <tr>
    <td bgcolor="#000000">&nbsp;</td>
    </tr>
</table>
</div>
      <br />
	  	</form>
    </div>
    <br />
    <br />
    <!-- end #mainContent -->
  </div>
  <?php include('footer.php');?>
  <!-- end #container --></div>

</body>
</html>
<?php 
function recortaCadena($cantidad,$texto)
{	
	$aux = explode(" ",trim($texto));
	if(count($aux)>$cantidad)
	{
		$cadena = '';
		for($i=0;$i<$cantidad;$i++)
		{
			$cadena .= $aux[$i]." ";
		}
		$cadena .= "...";
		return $cadena;
	}
	else
		return $texto;
}
?>
<script language="javascript" type="text/javascript">
 
 function confirmarEliminacion(){

  if(confirm("¿Esta seguro de eliminar esta correspondecia?"))
   return true;
  else
   return false;
 }

 
</script>
